<template>
  <TreeListLayout
    contentPadding="0"
    style="margin:-24px;"
    :showTree="false">
    <div
      class="iv-cover-input"
      slot="layout-content">
      <Form
        :model="formItem"
        :rules="ruleValidate"
        label-position="top"
        class="iv-form-modal-1 "
        ref="Form">
        <#list module.fields as field>
        <Row :gutter="32">
          <Col span="8">
          <#if (field.constraint.controlType)?? && field.constraint.controlType=='Select'>
            <FormItem
              prop="${field.name}"
              label="${field.explain}">
              <Select
                v-model="formItem.${field.name}"
                class="uit-select-list"
                placeholder="请选择${field.explain}">
<@opt optionParams=field.constraint.optionParams element='true' indent=16 />
              </Select>
            </FormItem>
          <#else>
            <FormItem
              label="${field.explain}"
              prop="${field.name}"
              class="iv-fs-14">
              <Input
                v-model="formItem.${field.name}"
                class="uit-name-list" />
            </FormItem>
          </#if>
          </Col>
        </Row>
        </#list>
      </Form>
    </div>
  </TreeListLayout>
</template>
<script>
import TreeListLayout from '@/page/business/treelist-layout'
import validate from './validate'
import mixinValidate from '@/mixins/validate'
export default {
  mixins: [mixinValidate],
  props: {
    formItem: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  data () {
    return {
      ruleValidate: {}
    }
  },
  created () {
    this.ruleValidate = validate.call(this)
  },
  components: {
    TreeListLayout
  },
  methods: {
    validateFrom () {
      return this.validate('Form')
    }
  }
}
</script>
<style lang="scss" scoped>

</style>
